package com.chhh.cranelease.controller.Integratedmanage;

import com.chhh.cranelease.entity.PeopleLog;
import com.chhh.cranelease.model.PeopleLogModel;
import com.chhh.cranelease.model.ResponseCode;
import com.chhh.cranelease.service.IntegratedmanageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("peoplelog/")
public class PeopleLogController {

    @Autowired
    private IntegratedmanageService integratedmanageService;

    private ResponseCode responseCode = new ResponseCode();

    @RequestMapping("selectAllPeopleLog")
    public List<PeopleLogModel> selectAllPeopleLog(String s_name,String s_card,String pl_license,String state_name){
        return integratedmanageService.selectAllPeopleLog(s_name,s_card,pl_license,state_name);
    }

    @RequestMapping("updatePeopleLog")
    public ResponseCode updatePeopleLog(PeopleLog peopleLog){
        Integer peopleLogs = integratedmanageService.updatePeopleLog(peopleLog);
        responseCode.setErrorCode(0);
        responseCode.setStatus("你更改了"+peopleLogs+"记录");
        return responseCode;
    }

}
